Using the RTX64 RTDLL Template
RTX64 provides two templates in the Templates/Visual C++ branch in the supported versions of Microsoft Visual Studio:
- RTX64 Application – creates a project and solution for the development of RTX64 applications. For more information on this template, see Using the RTX64 Application Template.
- RTX64 RTDLL – creates a project and solution for the development of RTX64 Real-Time Dynamic-Link Library (RTDLLs).
The RTX64 project contains four build configurations: Windows Release, Windows Debug, RTSSRelease, and RTSSDebug. The RTX64 RTDLL Template sets the project settings for each configuration according to the program and project options that you specify. The template can also provide a basic C/C++ program framework with which to work. This program framework can include RTX64 program elements, which contain C/C++ code to create RTX64 objects and demonstrate their use.
NOTE: RTX64 only supports absolute pathnames.
IMPORTANT! If a version of the RTX64 SDK prior to RTX64 2014 with Service Pack 1 is installed on your system, in addition to the RTX64 4.5 SDK, the Application Wizard for that version will also be available in the Templates/Visual C++ branch in the supported versions of Microsoft Visual Studio. If you build a binary with the older wizard, you will only be able to run/load that Application or RTDLL in the RTX64 Runtime of the same version, and you will not be able to debug.
Sections in this Topic:
Creating an RTX64 RTDLL
RTX64 RTDLL template provides the structure for creating RTX64 RTDLLs. Use the following procedure to create an RTX64 project using any RTX64 RTDLL template in Microsoft Visual Studio.
NOTE: RTX64 does not support the building of managed RTSS applications. For additional information on using RTX64 from within a Windows managed code application, see the RTX64 Managed Code Reference Manual.
To create an RTX64 RTDLL project:
- Create a new project in Visual Studio.
- Select C or C++ as the template type.
- Select the RTX64 RTDLL template. This template is a single-page dialog that displays the default project settings and provides optional application and program settings.
- To accept the current settings, click Finish. Optionally, you can specify other options and libraries that you want to include in your RTX64 application project:
- SDK Version – If you have multiple versions of the SDK installed, select the version you want to use. Note that if you build a binary using the RTX64 2013 SDK, it will not load in any newer RTX64 Runtime versions. And if you build a binary using the RTX64 4.5 SDK, it will not load in previous versions of the RTX64 Runtime.
- Project Type – You can create a project in C or C++. Select the type of project source you want to create. This causes the generation of either .C or .CPP files, and determines which compiler to use when building your application.
- Supported String Convention – Specify Unicode, MultiByte, or Ansi. This determines if the associated pre-processor definitions will be included in the project settings.
- Add additional headers and libraries:
- RT-TCP/IP support – Adds support for the RT-TCP/IP Stack component within RTSS configurations and Windows socket libraries for Windows configurations.
- RT Network Abstraction Layer support – Adds support for the Network Abstraction Layer (NAL) component.
- Microsoft C Runtime support – Adds C/C++ Runtime support. Most programs need support for C Runtime functions.
- RTX64 Vision support – Adds support for RTX64 Vision. Note that this requires the RTX64 Vision SDK to be installed.
IMPORTANT! To debug the application once it has been created, you must build the binary using the SDK from RTX64 2014 with Service Pack 1 or later. Binaries built in older SDK versions will not support debugging functionality.
- If these are all the options needed, click Finish to create the project. Otherwise, continue editing program settings for this application.
- Provide a program framework – The RTX64 RTDLL Template can build a basic program framework consisting of source and header files, or it can build an empty project. When Provide a program framework is un-checked, the RTX64 RTDLL template sets only the project settings and does not include any header or C/C++ files, and all program elements become grayed-out. When Provide a program framework is checked, the RTX64 RTDLL template inserts into the project C/C++ source files that contain basic program functionality and header files that contain include and define statements. The program framework also contains a code segment for an exported function, exported variable, and an exported class.
When Provide a program framework is checked, you can optionally add elements to the program framework. These code segments show proper usage of Real-time API function calls and can serve as examples of how to set up these elements. Areas in the element code that need to be customized by the user are indicated by "TO DO" comments. You can select more than one type of programming element for a single project. The following table provides the available program elements.
NOTE: When Provide a program framework is un-checked, these options are grayed out.
- Click Finish. This generates the RTX64 solution and project according to the options you selected.
Element | Description |
---|---|
Periodic timer thread |
Transforms the basic Export function already in the program framework into TimerThread Export. |
RTX64 Custom Macro
RTX64 utilizes a custom macro, $(Rtx64Platform)
, that is used to find the correct library directory for projects. This custom macro requires two property files, which are installed with the RTX64 SDK:
- Rtx64.cpp.x64.user.props
- Rtx64.cpp.win32.user.props
All projects import these property files. If they are edited in any way, projects will not load correctly.
Resulting Configurations
Four configurations for creating DLLs are generated in Visual Studio when you create a project using the RTX64 RTDLL template:
x64
- RTSSDebug – Real-time DLL that has debug flags enabled
- RTSSRelease – Optimized Real-time DLL that does not include additional debug information
- Debug – Windows 64-bit DLL linked to RTX64 that has debug flags enabled
- Release – Windows 64-bit DLL linked to RTX64
For instructions on manually building a 32-bit RTDLL, see Building a 32-bit User Space Application.
Compiler and Linker Options
For a complete list, see Compiler and Linker Options for Visual Studio .
Related topics:
- Upgrading RTX64 Projects
- Supported Visual Studio Versions
- Supported .NET Versions
- Setting up Visual Studio for RTX64 Templates
- Using the RTX64 Application Template
- Compiler and Linker Options
- Using RTX64 Code Snippets in Visual Studio
- Building a 32-bit User Space Application
- Visual Studio C Runtime Support
- Creating a Managed Code Application